﻿


using System;
using System.Text;
using System.Collections;
using System.Xml;
using System.Data;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Resources;
using System.Reflection;
using System.Globalization;
using System.Threading;

using UFSoft.UBF.UI.WebControls;
using UFSoft.UBF.UI.WebControls.InterActionComponenet;
using UFSoft.UBF.Util.Log;
using UFSoft.UBF.Util.Context;

//using MagicAjax.UI.Controls;
using UFSoft.UBF.Report.UI.ReportView.Web;
using UFSoft.UBF.UI.WebControlAdapter;
using UFSoft.UBF.UI.FormProcess;
using UFSoft.UBF.UI.IView;
using UFSoft.UBF.UI.Engine;
using UFSoft.UBF.UI.Engine.Builder;
using UFSoft.UBF.UI.Engine.Authorization;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.ActionProcess;
using UFSoft.UBF.UI.ControlModel;
using UFSoft.UBF.UI.Controls;
using UFSoft.UBF.UI.WebControls.Association;
using UFSoft.UBF.UI.WebControls.ClientCallBack;
using System.Web.UI;
using UFSoft.UBF.UI.UIFormPersonalization;
using System.Collections.Specialized;


/***********************************************************************************************
 * Form ID:e02a09c8-e0c2-4815-8193-79798ba2849a 
 * Form Name:MFHSDStdUnitCostUIForm
 * UIFactory Auto Generator
 ***********************************************************************************************/
namespace MF.HSD.MFHSDStdUnitCostUIModel
{
	[FormRegister("MF.HSD.MFHSDProject_UIProject","MF.HSD.MFHSDStdUnitCostUIModel.MFHSDStdUnitCostUIFormWebPart", "MF.HSD.MFHSDProject_UIProject.WebPart", "e02a09c8-e0c2-4815-8193-79798ba2849a","WebPart", "False", 320, 208)] 
	///insert into aspnet_Parts (SysVersion, Path, ClassName, [Assembly], FormId) values (0, 'MF.HSD.MFHSDProject_UIProject', 'MF.HSD.MFHSDStdUnitCostUIModel.MFHSDStdUnitCostUIFormWebPart', 'MF.HSD.MFHSDProject_UIProject.WebPart', 'e02a09c8-e0c2-4815-8193-79798ba2849a')
	///<siteMapNode url="~/erp/simple.aspx?lnk=e02a09c8-e0c2-4815-8193-79798ba2849a" title="MFHSDStdUnitCostUIForm"/>
    public partial class MFHSDStdUnitCostUIFormWebPart : UFSoft.UBF.UI.FormProcess.BaseWebForm
    {
		#region Page Controller/Code Behind
        private static readonly ILogger logger = LoggerManager.GetLogger(typeof(MFHSDStdUnitCostUIFormWebPart));
        private string assemblyName = System.Reflection.Assembly.GetExecutingAssembly().FullName;
        //private string displayNamePostfix = "displayName";

		#region 强类型化基类属性.
		public new MFHSDStdUnitCostUIModelAction Action
		{
			get { return (MFHSDStdUnitCostUIModelAction)base.Action; }
			set { base.Action = value; }
		}
		MFHSDStdUnitCostUIModelModel _uimodel=null;
		public new MFHSDStdUnitCostUIModelModel Model
		{
			get 
			{
			     if(_uimodel == null){
			          _uimodel = new MFHSDStdUnitCostUIModelModel();
			     }
			     return _uimodel; 
			}
			set { _uimodel = value; }
		}
        protected override IUIModel UIModel{
            get{
                return this.Model;
            }
            set{
                this.Model = value as MFHSDStdUnitCostUIModelModel;
            }
        }
		#endregion 
		public FormAdjust adjust;
        #region variable declaration
        IUFCard Card0;
        IUFLabel lblID203;
        IUFFldNumberControl ID203;
        IUFLabel lblSysVersion281;
        IUFFldNumberControl SysVersion281;
        IUFLabel lblCostField158;
        IUFFldReference CostField158;
        IUFLine Line1;
        IUFCard Card1;
        IUFButton BtnClose;
        IUFButton BtnOk;
		UpdatePanel updatePanel;
		HiddenField wpFindID;
		IUFContainer topLevelPanel;     
        IUFSeparator SeparatorInFavorites;
        IUFButton BtnDefaultValues;
        #endregion
        
        #region constructor
        public MFHSDStdUnitCostUIFormWebPart()
        {
            FormID = "e02a09c8-e0c2-4815-8193-79798ba2849a";
            IsAutoSize = bool.Parse("False");
            NewIsAutoSize = bool.Parse("False");
        }
        #endregion


	
            
	//获取档案版型结果: 

        #region eventBind and databind
        private void EventBind()
        {
			//事件绑定模板
				//Button控件事件
			this.BtnClose.Click += new EventHandler(BtnClose_Click);		
						
				//Button控件事件
			this.BtnOk.Click += new EventHandler(BtnOk_Click);		
						

	
            AfterEventBind();
        }
        #endregion            
        
		#region override method
		protected override void OnLoad(EventArgs e)
		{
			base.OnLoad2(e);
		}
		protected override void OnLoadDataDo(EventArgs e)
		{
		    adjust.ProcessAdjustBeforeOnLoad(this);
			if (UIEngineHelper.IsDataBind(PageStatus, this))
			{
				if(this.Model==null){				        
					this.Model = new MFHSDStdUnitCostUIModelModel();
				}
				OnLoadConsumer(new InParameterModel[]{},new InParameterModel[]{});
				OnLoadData(this);
				this.IsDataBinding = true ; //加载完数据要绑定一次.目前加这.
			}
			else
			{
				//去除.已经移入到OnInit()中.
				//this.Model = (MFHSDStdUnitCostUIModelModel)this.CurrentState[this.TaskId.ToString()];
			}
			adjust.ProcessAdjustAfterOnLoadData(this);
		            AfterOnLoad();
            
            adjust.ProcessAdjustAfterOnLoad(this);
		}
		protected override void OnPreRender(EventArgs e)
		{
			base.OnPreRender2(e);
		}
        protected override void OnPreRenderDo(EventArgs e)
        {
            adjust.ProcessAdjustBeforeOnPreRender(this);
			base.OnPreRender(e);
			this.CurrentState[this.TaskId.ToString()] = this.Model;
			RegisterClearWebPartPadding();
            UFIDA.U9.UI.PDHelper.FormAuthorityHelper.SetWebPartAuthorization(this);
            
			if (IsDataBinding) //2006-9-7 可由开发人员控制
			{
				BeforeUIModelBinding();
								if(!Page.IsPostBack)
				{
					EnumTypeBinding.BindEnumControls(this);
				}
				UFIDA.U9.UI.Commands.CommandHelper.BindFlexData(this);
				adjust.ProcessAdjustBeforeDataBinding(this);
				if (this.IsOnlyDataBinding)
				{
					this.DataBinding();
				}
				adjust.ProcessAdjustAfterDataBinding(this);

				AfterUIModelBinding();
			}
			adjust.ProcessAdjustAfterOnPreRender(this);
        }
		protected override void OnInit(EventArgs e)
		{
			base.OnInit2(e);
		}
		protected override void OnInitDo(EventArgs e)
		{			 
			this.Page.InitComplete += new EventHandler(Page_InitComplete);
			WebPartBuilder.InitWebPart(this);
            this.Action = new MFHSDStdUnitCostUIModelAction(this);
            adjust = new FormAdjust();
		    CreateFormChildControls();
		}
        void Page_InitComplete(object sender, EventArgs e)
        {

            adjust.ProcessInit(this);
        }
        #endregion

      
        
        #endregion

	
		/// <summary>
        /// WebPart View
        /// </summary>
        #region view Create Contorls
        private void CreateFormChildControls()
        {
            IUFContainer _panel = UIControlBuilder.BuildTopLevelContainer(this,"MFHSDStdUnitCostUIForm",true,320,208);
            CommonBuilder.ContainerGridLayoutPropBuilder(_panel, 1, 2, 0, 10, 10, 10, 10, 10);
			InitViewBindingContainer(this, _panel,  null, "", "", null, 1, "");
			UIControlBuilder.BuildContainerGridLayout(_panel, 10,new GridColumnDef[]{new GridColumnDef(295,bool.Parse("True"),"Title"),},new GridRowDef[]{new GridRowDef(151,bool.Parse("True")),new GridRowDef(25,bool.Parse("True")),});
            //???还有用么?
            topLevelPanel = _panel;    
            
            UIControlBuilder.BuildCommonControls(this,ref updatePanel,ref wpFindID);
            





	
			_BuilderControl_Card0(_panel);

		
			UIControlBuilder.BuilderUFControl(this.Card0, "1");		


	
			_BuilderControl_Card1(_panel);

		
			UIControlBuilder.BuilderUFControl(this.Card1, "2");		



		
     
			
			
            EventBind();
            AfterCreateChildControls();
            
        }        







	                   
        private IUFCard _BuilderControl_Card0(IUFContainer container)
        {
            IUFCard _UFCard = UIControlBuilder.BuildCard(container,"Card0",false,"none", true, true, "1","10843c37-3b65-4c01-909f-a2af453d9c78","581f8e6f-3038-48e6-ade5-3fa5f1be4b02");
			CommonBuilder.GridLayoutPropBuilder(container, _UFCard, 295, 151, 0, 0, 1, 1, "100");
            CommonBuilder.ContainerGridLayoutPropBuilder(_UFCard, 3, 6, 0, 5, 0, 0, 0, 0);
			InitViewBindingContainer(this, _UFCard,  this.Model.MFHSDStdUnitCostUI, "MFHSDStdUnitCostUI", "", null, 1, "");
			UIControlBuilder.BuildContainerGridLayout(_UFCard, 5,new GridColumnDef[]{new GridColumnDef(145,bool.Parse("True"),"Title"),new GridColumnDef(5,bool.Parse("True"),"Spacing"),new GridColumnDef(145,bool.Parse("True"),"Value"),},new GridRowDef[]{new GridRowDef(20,bool.Parse("True")),new GridRowDef(20,bool.Parse("True")),new GridRowDef(20,bool.Parse("True")),new GridRowDef(20,bool.Parse("True")),new GridRowDef(20,bool.Parse("True")),new GridRowDef(20,bool.Parse("True")),});
            this.Card0 = _UFCard;

            ///foreach UFCard下的所有控件，增加到此容器





				this.lblID203 = UIControlBuilder.BuilderUFLabel(_UFCard, "lblID203", "", "False", "True", "Right", 145, 20, 0, 0, 1, 1, "100","10843c37-3b65-4c01-909f-a2af453d9c78","0099a2af-9db3-4bae-a733-7bf55045f977");


								

		
			UIControlBuilder.BuilderUFControl(this.lblID203, "0");		


				this.ID203 = UIControlBuilder.BuilderNumberControl(_UFCard, "ID203", "False", "False", "True", "Left", 7, 60, 0, 145, 20, 0, 0, 1, 1, NumbericType.Numberic, "100",79228162514264337593543950335m, -79228162514264337593543950335m
			,TextAlign.Right,0,true,false,true,"lblID203","","10843c37-3b65-4c01-909f-a2af453d9c78","09b30e6e-e0ff-429f-8442-35ce99d2ea0f",null,null,null, null);
			UIControlBuilder.BuilderUIFieldBindingControl(this, this.ID203, "False", "ID", this.Model.MFHSDStdUnitCostUI, this.Model.MFHSDStdUnitCostUI.FieldID, "MFHSDStdUnitCostUI");
	
		
			UIControlBuilder.BuilderUFControl(this.ID203, "1");		
		 

				this.lblSysVersion281 = UIControlBuilder.BuilderUFLabel(_UFCard, "lblSysVersion281", "", "False", "True", "Right", 145, 20, 0, 0, 1, 1, "100","544c8274-b47e-479f-b242-14cbc860d0f8","5df18095-d65d-4fcc-9cda-ad122732d460");


								

		
			UIControlBuilder.BuilderUFControl(this.lblSysVersion281, "2");		


				this.SysVersion281 = UIControlBuilder.BuilderNumberControl(_UFCard, "SysVersion281", "False", "False", "True", "Left", 7, 60, 0, 145, 20, 0, 0, 1, 1, NumbericType.Numberic, "100",79228162514264337593543950335m, -79228162514264337593543950335m
			,TextAlign.Right,0,true,false,true,"lblSysVersion281","","544c8274-b47e-479f-b242-14cbc860d0f8","0a1a59a1-b1af-4118-889e-398b2f8a08d4",null,null,null, null);
			UIControlBuilder.BuilderUIFieldBindingControl(this, this.SysVersion281, "False", "SysVersion", this.Model.MFHSDStdUnitCostUI, this.Model.MFHSDStdUnitCostUI.FieldSysVersion, "MFHSDStdUnitCostUI");
	
		
			UIControlBuilder.BuilderUFControl(this.SysVersion281, "3");		
		 

				this.lblCostField158 = UIControlBuilder.BuilderUFLabel(_UFCard, "lblCostField158", "", "True", "True", "Right", 145, 20, 0, 1, 1, 1, "100","d51de9a9-91c5-42f0-ae22-110307c3d10e","7290ff58-66f7-4804-b356-8e795a176f1b");


								

		
			UIControlBuilder.BuilderUFControl(this.lblCostField158, "4");		


				this.CostField158 = UIControlBuilder.BuilderRefrenceControl(_UFCard,"CostField158",false,true, true,145, 20, 2, 1, 1, 1, "100","5",false,false,true,"lblCostField158","d51de9a9-91c5-42f0-ae22-110307c3d10e","af3d3508-62e9-4bdb-99df-7c399280ee2e");
			UIControlBuilder.BuilderUIFieldBindingControl(this, this.CostField158, "False", "CostField", this.Model.MFHSDStdUnitCostUI, this.Model.MFHSDStdUnitCostUI.FieldCostField, "MFHSDStdUnitCostUI");
			UIControlBuilder.SetReferenceControlRefInfo(this.CostField158,"09d036c2-6e7b-44ce-b8a6-78bcb725ff85", 580,408, "Name","Code","ID", this.Model.MFHSDStdUnitCostUI.FieldCostField_Code,this.Model.MFHSDStdUnitCostUI.FieldCostField_Name);
            //foreach Reference's input filter parameter
            //foreach Reference's output set data, columnID锛屽弬鐓ц繑鍥炲垪鐨凢ieldID
			ScriptBuilder.BuildReferenceControlOuputScript(this.CostField158,"CostField158",new ReferenceOutputParam[]{new ReferenceOutputParam("","ID",""),new ReferenceOutputParam("","Code",""),new ReferenceOutputParam("","Name",""),});
				

		
			UIControlBuilder.BuilderUFControl(this.CostField158, "5");		
		 

				this.Line1 = UIControlBuilder.BuilderUFLine(_UFCard, "Line1", 295, "Horizontal", "True", 295, 20, 0, 0, 3, 1, "100","9fb152b2-e2fb-44be-9257-d2e8c0a7f791","9fb152b2-e2fb-44be-9257-d2e8c0a7f791");
	

		
			UIControlBuilder.BuilderUFControl(this.Line1, "6");		



						
			this.CostField158.IsMultiOrg  = false ;
			this.lblCostField158.SetMultiOrgInfo(this.CostField158,false);
			
	

            
            container.Controls.Add(_UFCard);
            return _UFCard;
        }

				

	                   
        private IUFCard _BuilderControl_Card1(IUFContainer container)
        {
            IUFCard _UFCard = UIControlBuilder.BuildCard(container,"Card1",false,"FunctionBar", true, true, "2","","2eb62d61-9b04-49c8-9567-11b01159853e");
			CommonBuilder.GridLayoutPropBuilder(container, _UFCard, 295, 25, 0, 1, 1, 1, "100");
            CommonBuilder.ContainerGridLayoutPropBuilder(_UFCard, 6, 1, 0, 0, 0, 0, 10, 0);
			InitViewBindingContainer(this, _UFCard,  null, "", "", null, 1, "");
			UIControlBuilder.BuildContainerGridLayout(_UFCard, 0,new GridColumnDef[]{new GridColumnDef(5,bool.Parse("True"),"Value"),new GridColumnDef(80,bool.Parse("True"),"Spacing"),new GridColumnDef(30,bool.Parse("True"),"Spacing"),new GridColumnDef(80,bool.Parse("True"),"Spacing"),new GridColumnDef(10,bool.Parse("True"),"Spacing"),new GridColumnDef(80,bool.Parse("True"),"Spacing"),},new GridRowDef[]{new GridRowDef(20,bool.Parse("False")),});
            this.Card1 = _UFCard;

            ///foreach UFCard下的所有控件，增加到此容器





				this.BtnClose = UIControlBuilder.BuilderUFButton(_UFCard, true, "BtnClose", true, true, 80, 20, 5, 0, 1, 1, "100","", this.Model.ElementID,"",false,"020a5365-8f12-4970-b8df-17ce3ae60a68","020a5365-8f12-4970-b8df-17ce3ae60a68","70fbd821-8c64-4c0b-be66-c5b54b44388b");
	

		
			UIControlBuilder.BuilderUFControl(this.BtnClose, "3");		


				this.BtnOk = UIControlBuilder.BuilderUFButton(_UFCard, true, "BtnOk", true, true, 80, 20, 3, 0, 1, 1, "100","", this.Model.ElementID,"",false,"626ebf9b-f65a-4dd5-8f32-96f84919878c","626ebf9b-f65a-4dd5-8f32-96f84919878c","9556a885-6ce2-4778-bc79-632fcf03b2fc");
	

		
			UIControlBuilder.BuilderUFControl(this.BtnOk, "2");		



		

            
            container.Controls.Add(_UFCard);
            return _UFCard;
        }





		#endregion
		

	}
}
